Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 左侧的菜单数据
    leftMenuList: ['迪迦奥特曼', '泽塔奥特曼', '捷德奥特曼', '赛罗奥特曼'],
    // 右侧的商品数据
    rightContent0: [
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods2.jpeg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods3.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods4.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods5.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods6.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods21.jpeg'
    ],
    rightContent1: [
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods1.jpeg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods7.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods8.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods9.jpg'
    ],
    rightContent2: [
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods10.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods11.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods12.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods18.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods19.jpg'
    ],
    rightContent3: [
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods13.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods14.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods15.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods16.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods17.jpg',
      'cloud://ultraman-8g0hcrf7c8afe553.756c-ultraman-8g0hcrf7c8afe553-1306160066/Ultraman/goods20.jpeg'
    ],
    // 被点击的左侧的菜单
    currentIndex: 0,
  },
  //切换商品
  handleItemTap: function(e){
    var that = this
    var currentIndex = e.currentTarget.dataset.index
    var rightContentShow = []
    switch (currentIndex) {
      case 0:
        rightContentShow = that.data.rightContent0
        break;
      case 1:
        rightContentShow = that.data.rightContent1
        break;
      case 2:
        rightContentShow = that.data.rightContent2
        break;
      case 3:
        rightContentShow = that.data.rightContent3
        break;
    }
    that.setData({
      currentIndex: currentIndex,
      rightContentShow: rightContentShow
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this
    that.setData({
      rightContentShow: that.data.rightContent0
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})